package team.epos.merchant.listener;

import team.epos.utils.util.DbUtil;
import team.epos.utils.util.ResourcesUtil;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import java.io.InputStream;

/**
 * Create by MyServletContextListener on 7/14/2018
 * @author XUVI7
 */
public class MyServletContextListener implements ServletContextListener {
    @Override
    public void contextInitialized(ServletContextEvent servletContextEvent) {
        InputStream in = MyServletContextListener.class.getClassLoader().getResourceAsStream("dbconf.properties");
        InputStream resourcesIn = MyServletContextListener.class.getClassLoader().getResourceAsStream("resources.properties");
        DbUtil.init(in);
        ResourcesUtil.init(resourcesIn);
    }

    @Override
    public void contextDestroyed(ServletContextEvent servletContextEvent) {

    }
}
